package com.example.pageradapterdemo.fragment;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.example.pageradapterdemo.R;

import java.util.Date;

public class Page0Fragment extends Fragment {
    private TextView tvTitle;
    private CheckBox checkBox;
    public Page0Fragment() {
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_my,container,false);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        tvTitle = view.findViewById(R.id.tv_title);
        checkBox = view.findViewById(R.id.chkStatus);
        checkBox.setVisibility(View.GONE);
    }

    @SuppressLint("SetTextI18n")
    public void updateDate(Date date){
        tvTitle.setText("当前时间:" + date.toString());
    }
}
